package org.niit.spark.connUil

import org.apache.spark.sql.DataFrame

import java.util.Properties

import java.util.Properties

class mysqlConn {

  def mysqlconn(counDataFrame: DataFrame, table: String): Unit ={
    val prop = new Properties()
    prop.setProperty("user", "root")
    prop.setProperty("password", "123456")
    prop.setProperty("driver", "com.mysql.cj.jdbc.Driver") // 5.7 mysql   //8.x  com.mysql.cj.jdbc.Driver
    counDataFrame.write.mode("append").jdbc("jdbc:mysql://localhost:3306/sparkTest", table , prop)


  }



}
